package com.augn.controller;

import com.augn.entity.PostEvaluateMain;
import com.augn.entity.Result;
import com.augn.service.IPostEvaluateMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author augn
 * @since 2022-09-22
 */
@RestController
@RequestMapping("/postEvaluateMain")
public class PostEvaluateMainController {

    @Autowired
    private IPostEvaluateMainService service;

    @PostMapping("/insertOne")
    public Result<?> insertOnePostEvaluateMain(@RequestBody PostEvaluateMain postEvaluateMain){
        return service.insertOnePostEvaluateMain(postEvaluateMain);
    }

    @DeleteMapping("/deleteOne/{id}")
    public Result<?> deleteOnePostEvaluateMain(@PathVariable Integer id){
        return service.deleteOnePostEvaluateMain(id);
    }

    @GetMapping("/getPart/{id}")
    public Result<?> getPartPostEvaluate(@PathVariable Integer id,
                                          @RequestParam(required = false) Integer pageNum,
                                          @RequestParam(required = false) Integer pageSize) {
        return service.getPartPostEvaluateMain(id,pageNum,pageSize);
    }
}
